#include<bits/stdc++.h>
#define int long long
#define INF (0x3f3f3f3f3f3f3f3f)
using namespace std;


signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n,m;
    cin>>n>>m;
    int a[n+1],b[n+1],c[n+1];
    c[0]=1;
    for (int i=1;i<=n;i++){
        cin>>a[i];
        c[i]=c[i-1]*a[i];
    }
    b[1]=m%c[1]/c[0];
    for (int i=2;i<=n;i++){
      b[i]=(m%c[i]-m%c[i-1])/c[i-1];
    }
    for (int i=1;i<=n;i++){
      cout<<b[i]<<" ";
    }
}